-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update erc-7007.md to add opML compatibility #1
Conversation
}, | ||
"verificaton": { | ||
"type": "string", | ||
"description": "Specify the verification method. Input zkML or opML." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense. want to propose another possible wording:
"proof_type": {
"type": "validity" / "fraud",
...
}
the point here is to align with "aigc_type".
we can discuss this.
ERCS/erc-7007.md
Outdated
*/ | ||
function verify( | ||
bytes calldata prompt, | ||
bytes calldata aigcData, | ||
bytes calldata proof | ||
bytes calldata proofOrState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good way to integrate. just a question:
I assume the 'state' means the state root hash in opml, provided by the submitter, but then can we still call it 'verify'? would like to see how does the opml challenger interact with this interface.
) | ||
); | ||
_setTokenURI(tokenId, tokenUri); | ||
tokenIdToRequestId[tokenId] = IOpmlLib(opmlLib).initOpmlRequest(keccak256(prompt)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IOpmlLib(opmlLib).uploadResult(tokenIdToRequestId[tokenId], keccak256(aigcData));
bytes calldata proof | ||
) public view virtual override returns (bool success) { | ||
uint256 tokenId = uint256(keccak256(prompt)); | ||
return IOpmlLib(opmlLib).isFinalized(tokenIdToRequestId[tokenId]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint256 tokenId = uint256(keccak256(prompt));
bytes32 output = IOpmlLib(opmlLib).getOutputHash(tokenIdToRequestId[tokenId]);
return IOpmlLib(opmlLib).isFinalized(tokenIdToRequestId[tokenId]) && (output == keccak256(aigcData));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should utilize the output (aigcData) in function mint and verify to check the result.
pragma solidity ^0.8.18; | ||
|
||
interface IOpmlLib { | ||
function initOpmlRequest(bytes32 inputHash) external returns (uint256 requestId); // we can construct the initialState using the input, can replace input with prompt (string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function initOpmlRequest(bytes calldata input) external returns (uint256 requestId);
|
||
interface IOpmlLib { | ||
function initOpmlRequest(bytes32 inputHash) external returns (uint256 requestId); // we can construct the initialState using the input, can replace input with prompt (string) | ||
function uploadResult(uint256 requestId, bytes32 output) external; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function uploadResult(uint256 requestId, bytes calldata output) external;
function proposeState(uint256 challengeId, bytes32 stateHash) external; | ||
function assertStateTransition(uint256 challengeId) external; | ||
function isFinalized(uint256 requestId) external view returns (bool); | ||
function getOutputHash(uint256 requestId) external view returns (bytes32 output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function getOutput(uint256 requestId) external view returns (bytes memory output);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace bytes32 (input/output) in IOpmlLib.sol
with bytes (we cann allow upload the whole data or only the hash)
* Update erc-7007.md to add opML compatibility (#1) * Update erc-7007.md to add opML compatibility * Update erc-7007.md param name * Create IOpmlLib.sol * Update and rename ERC7007.sol to ERC7007_zkml.sol * Update IOpmlLib.sol * Update IOpmlLib.sol * Update IOpmlLib.sol * Create ERC7007_opml.sol * Update ERC7007_opml.sol * Update IOpmlLib.sol * feat: update implementation to include owner address * feat: update authorship, added Updatable extension, update metadata with `proof_type` * fix: full term before abbreviation * feat: Update ERC7007 contracts and add IERC7007Updatable interface * feat: Add rationale and security considerations * feat: `update` function to use `verify` in `require` statement * misc: capitalization * xhyu patch 1 (#2) * misc: improve abstract & motivation * fix: Spec intro & Model Publication wording * fix: Rewrite part of motivation * corrected some small typos * rewrote the last two paragraphs in Motivation --------- Co-authored-by: drCathieSo.eth <[email protected]> * fix: proposal reference and header * fix: file references * Update erc-7007.md: Fix wordings (#4) * Update erc-7007.md: Fix wordings * update license * Update description and motivation -> rationale --------- Co-authored-by: drCathieSo.eth <[email protected]> * Add workflow (#5) * Add workflow diagram * Add workflow description * Apply suggestions from code review Co-authored-by: Sam Wilson <[email protected]> * Update erc-7007.md * Fix uppercase keywords * Update erc-7007.md --------- Co-authored-by: 李婷婷 Lee Ting Ting <[email protected]> Co-authored-by: xhyumiracle <[email protected]> Co-authored-by: Sam Wilson <[email protected]>
When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md
We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met: